import React from 'react'
import TodoTable from '../../component/Table'
import { columnRenders } from '@/lib'

export default class QuotaTransferTable extends TodoTable {
  constructor(props) {
    super(props)
    this.state = {
      columns: [
        ...this.commonColumns,
        {
          title: '操作', dataIndex: 'operate', width: 100, render: columnRenders.operate([
            { title: '查看详情', auth: 'my_backlog_quota_quotachangworkflowdetail', action: (text, model) => this.goDetail(model) }
          ])
        },
      ],
    }
  }

  public goDetail = (row) => {
    const { id, taskDefId, traceCode: businessKey, brandCode } = row
    const { todoType } = this.props
    this.props.history.push('/todo/quotatransfer/detail/' + id + '?taskId=' + taskDefId + '&type=' + todoType + '&businessKey=' + businessKey + '&brandCode=' + brandCode)
  }

}

